package cn.iocoder.yudao.module.ao.dal.mysql.classmajor;

import java.util.*;

import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.module.ao.dal.dataobject.classmajor.ClassMajorDO;
import org.apache.ibatis.annotations.Mapper;
import cn.iocoder.yudao.module.ao.controller.admin.classmajor.vo.*;

/**
 * 班级专业关联 Mapper
 *
 * @author lfl
 */
@Mapper
public interface ClassMajorMapper extends BaseMapperX<ClassMajorDO> {

    default PageResult<ClassMajorDO> selectPage(ClassMajorPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<ClassMajorDO>()
                .eqIfPresent(ClassMajorDO::getClassId, reqVO.getClassId())
                .eqIfPresent(ClassMajorDO::getMajorId, reqVO.getMajorId())
                .eqIfPresent(ClassMajorDO::getMajorDirectionId, reqVO.getMajorDirectionId())
                .betweenIfPresent(ClassMajorDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(ClassMajorDO::getId));
    }

}